import { ConverterBase } from './base';
import { Layout } from './cc';

export class GridConverter extends ConverterBase {
    public static prefix = 'grid-';

    public async convert() {
        const node = this.createNode();

        const ctor = ConverterBase.getCcPropFunc(Layout.name);
        const layout = node.addComponent(ctor);
        layout.type = ctor.Type.GRID;

        await this.addChildren(node);

        node.children[0].position = this.createVec3(0, 0);

        return node;
    }
}